import request from '@/utils/request'

// 获取所有角色列表
export const getRolesListRequest = params => request.get('/sys/role', { params })

// 添加角色
export const addRolesRequest = data => request.post('/sys/role', data)

// 编辑角色 - 只有 post put patch 这三个请求方法 有data属性 `/sys/role/${data.id}`
export const editRolesRequest = data => request.put(`/sys/role/${data.id}`, data)

// 删除角色
export const deleteRolesRequest = id => request.delete(`/sys/role/${id}`)

// 为角色分配权限
export const assignPermissionRequest = data => request.put('/sys/role/assignPrem', data)

// 根据 ID 获取角色详情
export const getRoleDetailByIdRequest = id => request.get(`/sys/role/${id}`)
